package com.lnn.springBase.exception;

import com.lnn.springBase.common.ResultEnum;
import lombok.Data;

@Data
public class BusinessException extends RuntimeException {

    private Integer code;

    private String message;

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message) {
        super(message);
        this.message = message;
    }

    public BusinessException(String message, Throwable cause) {
        super(cause);
        this.code = ResultEnum.INTERNAL_SERVER_ERROR.getCode();
        this.message = message;
    }

    public BusinessException(Integer code, String message, Throwable cause) {
        super(cause);
        this.code = code;
        this.message = message;
    }
}
